﻿using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using ControlCenter.Data;
using Microsoft.Extensions.DependencyInjection;
using MingYuanYun.Context;

namespace ControlCenter.ApplicationService.Jobs
{
    /// <summary>
    /// 任务状态刷新JOB接口
    /// </summary>
    public interface IRobotStatusUpdateJob
    {
        /// <summary>
        /// 执行任务
        /// </summary>
        void Run();
    }

    /// <summary>
    /// 任务状态刷新JOB
    /// </summary>
    public class RobotStatusUpdateJob : IRobotStatusUpdateJob
    {
        public void Run()
        {
            var robotService = ServiceLocator.Services.GetService<IRobotService>();
            robotService.RefreshWorkStatus();
        }
    }
}
